﻿@{
    ViewBag.Title = ViewBag.ParkingName + "区域列表";
    Layout = "~/Views/Shared/_Layout.cshtml";

}
@using AFT.Parking.Entity;
@using AFT.Parking.Foundation;
@using AFT.Parking.WebSite.Common;

@model IPagedList<ParkingAreaShare>
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>@ViewBag.ParkingAreaName 停车区域列表</h3>

        <div class="clear"></div>
    </div>
    <form id="frm">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <div class="notification attention png_bg">
                    区域名称：@Html.TextBox("name",null,new{@class="searchBox"})
                    <input type="submit" value="查询" class="button"/>
                    <a href="/parkingCamera/add?parkingAreaId=@ViewBag.ParkingAreaId">添加区域</a>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>名称</th>
                            <th>图片</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <td colspan="6">
                                <div class="pagination">
                                    @Html.Pager(Model)
                                </div>
                                <!-- End .pagination -->
                                <div class="clear"></div>
                            </td>
                        </tr>
                    </tfoot>
                    <tbody id="tBodyRows">
                        @foreach (var item in Model.Rows)
                        {
                            <tr id="@("tr"+item.Id)">
                                <td>
                                    @item.ShareName
                                </td>
                                <td><img src="@item.HighlightImg" style=" cursor:pointer;" width="80px" height="60px" onclick="window.open('@item.HighlightImg')" /></td>
                                <td>
                                    <a href="/parkingCamera/editAreaShare/@item.Id" title="Edit">编辑停车区域</a>
                                    <a href="javascript:void(0)" onclick="delAreaShare(@item.Id)" title="Delete">删除停车区域</a>
                                    <a href="/parkingCamera/CarsOfAreas?parkingAreaShareId=@item.Id" title="Edit">查看车牌信息</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <!-- End #tab1 -->
        </div>
        <!-- End .content-box-content -->
    </form>
</div>
<script type="text/javascript">
    function delAreaShare(id) {
        var choice = confirm("是否要删除此停车区?");
        if (choice) {
            $.ajax({
                url: "/parkingCamera/DelAreaShare/" + id,
                type: "Post",
                cache: false,
                success: function() {
                    $("#tr" + id).remove();
                }
            });
        }
    }
</script>
